<?php
// custom userfields
if( $gBitSystem->getConfig( 'custom_user_fields' ) ) {
	$customFields= explode( ',', $gBitSystem->getConfig( 'custom_user_fields' )  );
	$gBitSmarty->assign('customFields', $customFields);
}

$gBitSmarty->assign( 'home', $gContent->mInfo['login'] );

if ($gBitSystem->isPackageActive('stars') && $gBitSystem->isFeatureActive('stars_user_ratings')) {
	require(STARS_PKG_PATH."templates/user_ratings.php");
}
$gQueryUser = $gContent;
if( $gQueryUser->canCustomizeTheme() ) {
	$userHomeStyle = $gQueryUser->getPreference( 'theme' );
	if( isset( $userHomeStyle ) ) {
		$gBitSystem->setStyle($userHomeStyle );
		$gBitSystem->mStyles['styleSheet'] = $gBitSystem->getStyleCss( $userHomeStyle, $_REQUEST['home'] );
		$gBitSmarty->assign( 'userStyle', $userHomeStyle );
	}
}
$userHomeTitle = $gQueryUser->getPreference( 'homepage_title' );
if (!$userHomeTitle) {
	$userHomeTitle = $gQueryUser->getDisplayName()."'s Homepage";
}
$browserTitle = $userHomeTitle;

// need to loadLayout prematurely (usually happens in modules_inc.php) so we can see if we have any center pieces
if( $gQueryUser->canCustomizeLayout() ) {
	$homeName = $_REQUEST['home'];
} else {
	$homeName = ROOT_USER_ID;
}
$layout = HOMEPAGE_LAYOUT;
/*if( isset( $layout ) ) {
	$gBitSystem->loadLayout( $homeName, $layout, ACTIVE_PACKAGE, TRUE );
}*/
global $gCenterPieces;
$template['template'] = ( count( $gCenterPieces ) ? 'bitpackage:kernel/dynamic.tpl' : 'bitpackage:users/center_user_wiki_page.tpl' );
?>